Repository navigation
Conversation
- The Runners tab's enrollment tokens become pools: a card each with its
labels, what it needs now (from the demand endpoint, read every 15 s)
as a sentence and facts, its placement, and the runners it enrolled,
which leave the list above. Pools are made with labels and a placement,
and edited as they run (PATCH …/enrollment-tokens/{token}).
- A project's Settings get a Runners page: any runner, a pool by its
name, or labels of its own, and how long its sessions wait for those;
labels no runner has say so in amber, with who adds one.
- The runner row moves into a component of its own, shared by the list
and the pools.
|
fctl reviewed The Runners tab and the project's Runners page match the server's request types and label rules. The main gap is that a project can be pointed at someone's personal pool. On lines the diff doesn't show:
Reviewed by fctl · Review agent settings |
| const out: PoolChoice[] = (pools ?? []) | ||
| .filter((d) => !d.pool.closed || enrolled(d.runners) > 0) |
There was a problem hiding this comment.
A member's personal pool is offered to projects
Medium severity. poolChoices (and poolFor) ignore pool.owner, but the demand endpoint returns every pool, personal ones included, to admins. Choosing one in Settings → Runners saves its labels for the whole project, yet the server only lets a session use a pool with no owner or its own person (pool_for in do_fleet.rs), so everyone else's sessions wait for runners that never take them. The amber 'no runner has these labels' warning is also hidden, since poolFor finds that pool.
| const out: PoolChoice[] = (pools ?? []) | |
| .filter((d) => !d.pool.closed || enrolled(d.runners) > 0) | |
| const out: PoolChoice[] = (pools ?? []) | |
| .filter((d) => !d.pool.owner && (!d.pool.closed || enrolled(d.runners) > 0)) |
Found by fctl review in e72d7ad.
There was a problem hiding this comment.
Fixed in d0f7d35, in #648, since this pull request has merged. poolChoices skips pools with an owner and runners whose personal names the workspace, and poolFor skips pools with an owner, so a member's own pool is neither offered nor counted against the amber warning. The project's check for runners with its labels skips such runners too.
| </div> | ||
| {save.error && !field && <Banner tone="error">{save.error.message}</Banner>} | ||
| <div className="flex justify-end gap-2"> | ||
| <Button variant="ghost" onClick={close}> |
There was a problem hiding this comment.
Cancel in the Edit pool form is a submit button
Low severity. Button sets no default type, so Cancel inside the <form onSubmit> submits it. Clicking Cancel after changing a field can save those changes. The repo's other forms set type="button" on Cancel.
| <Button variant="ghost" onClick={close}> | |
| <Button type="button" variant="ghost" onClick={close}> |
Found by fctl review in e72d7ad.
| typed: (p.settings.runner_labels ?? []).join(", "), | ||
| fallback: p.settings.runner_fallback_minutes ?? null, | ||
| }); | ||
| toast(`Sessions that start from now on run on ${where(p)}`); |
There was a problem hiding this comment.
Saving the Runners page shows two toasts
Low severity. useSave already toasts 'Saved' after calling the saved callback, and this callback adds a second toast. No other page's saved callback toasts, so each save shows two messages.
Found by fctl review in e72d7ad.
| const none = | ||
| labels.length > 0 && | ||
| !problem && | ||
| runners.data !== undefined && |
There was a problem hiding this comment.
'No runner has these labels' warning flashes while pools load
Low severity. none only waits for runners.data. Until the demand query answers, poolFor gets an empty list, so a project whose labels match a pool with no runners yet shows the amber warning for a moment, then it disappears.
| runners.data !== undefined && | |
| runners.data !== undefined && | |
| !demand.isPending && |
Found by fctl review in e72d7ad.
…pp' into fctl/1545-pools-in-the-web-app # Conflicts: # docs/llms.txt
## Summary Making a pool now follows the Runners tab's step-by-step setup, as #615's design asks. New pool asks in three steps: name it; its labels and machines (labels, placement, sessions each machine runs, runners at once, offline removal, approval, expiry); and where it runs (your own machines, AWS, Google Cloud, Azure or Kubernetes). A live summary says what the pool will do, and a preview shows its card once its first runner is online. Choosing a cloud removes runners once offline and packs sessions, as autoscaled machines want. Once the pool is made, the dialog shows the token once, then the steps for where its machines run, with every value of this instance and this pool filled in: - **Your own machines:** install fctl, then enroll with the token at the chosen capacity. - **AWS:** the token in a file, fctl's Terraform module (named after the pool, with the instance, its version, the capacity and a `max_size` a few below the pool's limit; the VPC and subnets left to fill in), then `terraform apply`. - **Google Cloud:** build the image with Packer, fill in the example's `terraform.tfvars` (the token stays out of it), then apply with the token in `TF_VAR_enrollment_token`. - **Azure:** make the image's resource group, gallery and image definition, named after the pool, then build the image into that gallery with Packer (the template now takes `azure_gallery`). Then fill in `terraform.tfvars` from the same shell (the subscription, the location, the image's ID, and a resource group of the scale set's own) and apply with the token in `TF_VAR_enrollment_token`. - **Kubernetes:** the token in a secret, the host as a Deployment (linking to the role and the preStop hook in Self-hosting), and a TriggerAuthentication with a ScaledObject whose metrics-api trigger reads the pool's demand. I verified it with unit tests that check each place's steps hold the instance, the token and the pool's values (and `YOUR_FCTL_VERSION`, with where to find it, while the app hasn't heard the instance's version), a component test of the steps from the form to the AWS setup, and in `cargo xtask dev` in both themes and at a phone's width. The Azure commands follow the guide's step 7, but nothing ran in a real cloud account. It is stacked on #644. The AWS, Google Cloud and Azure steps use `deploy/cloud` and its Terraform, which #639 added. Refs #615 - #644 - #639 - hyperstructure/design#80 ## Screenshots At d62c20b, from `cargo xtask dev`. New pool, with AWS chosen, then what it shows once made, light: | The steps | Once made | |---|---| |  |  | Kubernetes in the dark theme, and Google Cloud at a phone's width: | Kubernetes | Google Cloud, 390 px | |---|---| |  |  | ## Worth confirming - **Decision:** "Sessions each machine runs" is in the form though it isn't the token's: it only shapes the commands and Terraform it gives to copy (`--capacity`, `capacity`). - **Decision:** the AWS module's source isn't pinned to the instance's version, because a release before #639 has no module; the step says to pin it with `?ref=`. - **Decision:** Kubernetes gets the secret and KEDA's objects in full but the host's Deployment only in words with a link, since running the host's sandboxes in a cluster is the Kubernetes driver's work (#617). - **Decision:** choosing a cloud switches "When they go offline" from Keep them to Remove after 5 minutes, and with it the placement to packed, until someone changes them. [fctl session](https://app.fctl.sh/s/ses_01M84BNFZPNEXTHDT8WGN1Q6JY) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Low risk.** It adds a step-by-step new-pool dialog and generated setup text to the web app, and a template variable for the Azure image build; nothing here touches stored data or permissions. > > **What it does.** Making a pool in the Runners tab now goes in three steps (name, labels and machines, where it runs), with a live summary and a preview of the pool's card. Once the pool is made, the dialog shows the token once and then the steps for the chosen place (own machines, AWS, Google Cloud, Azure or Kubernetes), with the instance's values and the pool's settings filled in. Azure's steps make the image's gallery first, and the Packer template takes it as a new `azure_gallery` variable. > > **Packer template.** `deploy/cloud/fctl-runner.pkr.hcl` gets an `azure_gallery` variable that defaults to the old `acme_runners`, so the guide keeps working; the guide's copy of the template changes with it. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M869JFYMV5K3XNY5YZN1325F)'s first look at [`d92acb9`](d92acb9) · 12 files, +831 −156 · [Review agent settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub> <!-- /FCTL_REVIEW_SUMMARY --> --------- Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Summary
This is the pools' web part of #615: an admin sees each pool's state at a glance, and a project chooses a pool by its name.
The design docs in hyperstructure/design describe both. I verified it with unit tests for the pool wording, the cards, the form and the settings page, and in
cargo xtask dev: a pool "AWS large" with two runners, filled by ten long sessions of a project that asks for its labels, with two left waiting ("Waiting for AWS large: its runners are busy"), in both themes and at a phone's width.It is stacked on #643 and goes in after it. "Making a pool" step by step, with what each cloud needs, comes in a follow-up that builds on #639's Terraform module.
Refs #615
Screenshots
At e72d7ad, from
cargo xtask dev: the Runners tab's pools, with "AWS large" full and two sessions waiting. Light, dark, and dark at a phone's width:The new pool form, with labels and placement:
A project's Settings → Runners, with its choices open, then dark:
Worth confirming
fctl runners enrollment-tokensbesidefctl runners pools.fctl session
Note
Medium risk. It changes the Runners tab and a project's runner settings, which admins and maintainers use to decide where sessions run. A wrong pool choice leaves sessions waiting for runners that never take them.
What it does. The Runners tab now calls enrollment tokens pools. Each pool is a card with its labels, a live sentence on what it needs (read every 15 seconds from the demand endpoint), and the runners it enrolled. Admins can make and edit pools. A project's Settings → Runners lets a maintainer choose Any runner, a pool by name, or labels of their own, and warns when no runner or pool has the labels.
Personal pools offered to projects.
poolChoicesdoesn't skip pools that belong to a person, so an admin can pick one for a whole project and everyone else's sessions then wait for runners that never take them.fctl review's first look at
6e34128· 16 files, +1480 −200 · Review agent settings